package com.photolibrary.base.load;

import android.support.annotation.NonNull;
import android.widget.ImageView;

/**
 * 作者： ch
 * 时间： 2018/4/10 0010-上午 10:45
 * 描述：
 * 来源：
 */


public interface IMediaLoader {


    /**
     * display thumbnail images for a ImageView.
     *
     * @param img     the display ImageView. Through ImageView.getTag(R.string.boxing_app_name) to get the absolute path of the exact path to display.
     * @param absPath the absolute path to display, may be out of date when fast scrolling.
     * @param width   the resize with for the image.
     * @param height  the resize height for the image.
     */
    void displayThumbnail(@NonNull ImageView img, @NonNull String absPath, int width, int height);

    /**
     * display raw images for a ImageView, need more work to do.
     *
     * @param img     the display ImageView.Through ImageView.getTag(R.string.boxing_app_name) to get the absolute path of the exact path to display.
     * @param absPath the absolute path to display, may be out of date when fast scrolling.
     * @param width   the expected width, 0 means the raw width.
     * @param height  the expected height, 0 means the raw height.
     */
    void displayIMG(@NonNull ImageView img, @NonNull String absPath, int width, int height);


    void displayIMGNocrop(ImageView img, @NonNull String absPath);

    void downImg(String url, FileCallBack callBack);

    interface FileCallBack {

        void onSuccess(String path);

        void onFail(String msg);

        void onProgress(long totalSize, long downSize);
    }
}
